package com.zcy.model;
import java.util.Random;

//创建图层类
public class Layer {
    //行
    private Integer rowsNum;
    //列
    private Integer colsNum;
    //容量
    private Integer capacity;
    //牌的数量 当前数量
    private Integer size;
    //二维数组存储格子对象
    private Cell [][] cells;
    //设置偏移
    private Integer offsetx;
    private Integer offsety;

    private Layer parent;

    public void setOffsety(Integer offsety) {
        this.offsety = offsety;
    }

    public Layer getParent() {
        return parent;
    }

    public void setParent(Layer parent) {
        this.parent = parent;
    }

    //构造方法
    public Layer(Integer rowsNum,Integer colsNum){
        //设置行和列
        this.rowsNum = rowsNum;
        this.colsNum = colsNum;
        //设置容量
        this.capacity = rowsNum * colsNum;
        this.size = 0;
        this.cells = new Cell[rowsNum][colsNum];
        //设置初始值
        this.offsetx = new Random().nextInt(100);
        this.offsety = new Random().nextInt(100);
    }

    public Integer getOffsetx() {
        return offsetx;
    }

    public void setOffsetx(Integer offestx) {
        this.offsetx = offestx;
    }

    public Integer getOffsety() {
        return offsety;
    }

    public void setOffsesty(Integer offesty) {
        this.offsety = offesty;
    }

    //生成set get方法
    public Integer getRowsNum() {
        return rowsNum;
    }

    public void setRowsNum(Integer rowsNum) {
        this.rowsNum = rowsNum;
    }

    public Integer getColsNum() {
        return colsNum;
    }

    public void setColsNum(Integer colsNum) {
        this.colsNum = colsNum;
    }

    public Integer getCapacity() {
        return capacity;
    }

    public void setCapacity(Integer capacity) {
        this.capacity = capacity;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public Cell[][] getCells() {
        return cells;
    }

    public void setCells(Cell[][] cells) {
        this.cells = cells;
    }
}
